#ifndef CUSTOMTEMPDIFF_H
#define CUSTOMTEMPDIFF_H

#include <QString>
#include <QWidget>
#include "TableWidgetForm.h"

struct Slotstruct
{
    int id;
    int out_sensor;
    int in_sensor;

    // 获取结构体成员名的字符串
    QString toFieldNames() const {
        return QString("out_sensor,in_sensor");
    }

    // 获取结构体成员名的字符串
    QStringList toFieldTypes() const {
        QStringList _list;
        _list << typeid(out_sensor).name();
        _list << typeid(in_sensor).name();
        return _list;
    }
};

class CustomTempDiff
{
public:
    CustomTempDiff();

    //初始化UI
    static void InitUI(const QString& fileName, QList<QPair<QWidget *, QString>>& widgets, QMap<int, QList<TableWidgetForm*>>& m_pTableWidgetFormMap);

    //保存
    static bool SaveUI(const QString& fileName, const QMap<int, QList<TableWidgetForm*>>& m_pTableWidgetFormMap);

    //解析
    static void Analysis(const QString& path, QList<QList<Slotstruct>> &slot);

    //保存
    static bool SaveXml(const QString& path, QList<QList<Slotstruct>> &slot);

};

#endif // CUSTOMTEMPDIFF_H
